import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
plt.rc('figure', figsize=(12,9))
a, b = 6, 6
x, y = np.linspace(0, a, 500), np.linspace(0, b, 500)
X, Y = np.meshgrid(x, y)
U = 2*X-X*Y
V = 2*X*Y-3*Y
plt.streamplot(X, Y, U, V)
strm = plt.streamplot(X, Y, U, V, color=np.sqrt(U**2+V**2),linewidth= 2, cmap=plt.cm.viridis)
plt.colorbar(strm.lines)